/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jtattoo.demo.app;

import com.jtattoo.plaf.luna.LunaLookAndFeel;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 *
 * @author michael hagen
 */
public class TabRenderingProblem3 {

    public static void main(String[] args) {

        try {
            UIManager.setLookAndFeel(new LunaLookAndFeel());
        } catch (UnsupportedLookAndFeelException e) {
        }

        JFrame frame = new JFrame();
        frame.setLayout(new BorderLayout());

        final JLabel label = new JLabel("Tab1");

        final JTabbedPane panel = new JTabbedPane();
        JPanel panel1 = new JPanel();

        frame.add(panel, BorderLayout.CENTER);
        panel.add(panel1);

        panel.setTabComponentAt(0, label);

        JButton button = new JButton("ndern");

        button.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                label.setText(label.getText() + " (2)");
            }
        });

        frame.add(button, BorderLayout.SOUTH);
        frame.addWindowListener(new WindowAdapter() {

            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }

        });

        frame.setSize(500, 200);
        frame.setVisible(true);

    }
}
